package com.test.mchelepesa.dialog_rice;

import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.ViewGroup;

import androidx.annotation.NonNull;

import com.test.mchelepesa.R;
import com.test.mchelepesa.util_rice.http_rice.HttpManager_rice;

public class BindAccountTipsDialog_rice extends Dialog {

    private final Runnable runnable;

    @SuppressLint("SetTextI18n")
    public BindAccountTipsDialog_rice(@NonNull Context context,Runnable runnable) {
        super(context);
        this.runnable = runnable;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_bind_account_tips_rice);

        getWindow().setBackgroundDrawableResource(R.color.trans);
        getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
        setCanceledOnTouchOutside(false);

        findViewById(R.id.bind_account_tips_continue_add).setOnClickListener(v -> {
            HttpManager_rice.getInstance().saveUserBuriedPoint("DIALOG_BIND_MORE_ACCOUNT_CONTINUE_ADD_CLICK");
            dismiss();
        });

        findViewById(R.id.bind_account_tips_tv_no_more_account).setOnClickListener(v -> {
            HttpManager_rice.getInstance().saveUserBuriedPoint("DIALOG_BIND_MORE_ACCOUNT_NO_MORE_CLICK");
            dismiss();
            if (runnable!=null) runnable.run();
        });

    }


}
